3.435 \(\int \cos ^4(c+d x) (a+b \tan ^2(c+d x)) \, dx\)

Optimal. Leaf size=61 \[ \frac {(a-b) \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac {(3 a+b) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {1}{8} x (3 a+b) \]

[Out]

1/8*(3*a+b)*x+1/8*(3*a+b)*cos(d*x+c)*sin(d*x+c)/d+1/4*(a-b)*cos(d*x+c)^3*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3675, 385, 199, 203} \[ \frac {(a-b) \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac {(3 a+b) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {1}{8} x (3 a+b) \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^4*(a + b*Tan[c + d*x]^2),x]

[Out]

((3*a + b)*x)/8 + ((3*a + b)*Cos[c + d*x]*Sin[c + d*x])/(8*d) + ((a - b)*Cos[c + d*x]^3*Sin[c + d*x])/(4*d)

Rule 199

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> -Simp[(x*(a + b*x^n)^(p + 1))/(a*n*(p + 1)), x] + Dist[(n*(p +
 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (In
tegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[p]
)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 3675

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rubi steps

\begin {align*} \int \cos ^4(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {a+b x^2}{\left (1+x^2\right )^3} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {(a-b) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {(3 a+b) \operatorname {Subst}\left (\int \frac {1}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{4 d}\\ &=\frac {(3 a+b) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {(a-b) \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {(3 a+b) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{8 d}\\ &=\frac {1}{8} (3 a+b) x+\frac {(3 a+b) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {(a-b) \cos ^3(c+d x) \sin (c+d x)}{4 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.13, size = 46, normalized size = 0.75 \[ \frac {(a-b) \sin (4 (c+d x))+12 a (c+d x)+8 a \sin (2 (c+d x))+4 b d x}{32 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^4*(a + b*Tan[c + d*x]^2),x]

[Out]

(4*b*d*x + 12*a*(c + d*x) + 8*a*Sin[2*(c + d*x)] + (a - b)*Sin[4*(c + d*x)])/(32*d)

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 49, normalized size = 0.80 \[ \frac {{\left (3 \, a + b\right )} d x + {\left (2 \, {\left (a - b\right )} \cos \left (d x + c\right )^{3} + {\left (3 \, a + b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/8*((3*a + b)*d*x + (2*(a - b)*cos(d*x + c)^3 + (3*a + b)*cos(d*x + c))*sin(d*x + c))/d

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check si
gn: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check si
gn: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check si
gn: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check si
gn: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check si
gn: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check si
gn: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check si
gn: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)(24*a*d*x*tan(c)^4*tan(d*x)^4+48*a*d*x*tan(c)^4*tan(d*x)^2+24*a*d*x*tan(c)^4+48*a*d*x*tan(c)^2*tan(d*x)^4+
96*a*d*x*tan(c)^2*tan(d*x)^2+48*a*d*x*tan(c)^2+24*a*d*x*tan(d*x)^4+48*a*d*x*tan(d*x)^2+24*a*d*x-40*a*tan(c)^4*
tan(d*x)^3-24*a*tan(c)^4*tan(d*x)-40*a*tan(c)^3*tan(d*x)^4+48*a*tan(c)^3*tan(d*x)^2+24*a*tan(c)^3+48*a*tan(c)^
2*tan(d*x)^3-48*a*tan(c)^2*tan(d*x)-24*a*tan(c)*tan(d*x)^4-48*a*tan(c)*tan(d*x)^2+40*a*tan(c)+24*a*tan(d*x)^3+
40*a*tan(d*x)+8*b*d*x*tan(c)^4*tan(d*x)^4+16*b*d*x*tan(c)^4*tan(d*x)^2+8*b*d*x*tan(c)^4+16*b*d*x*tan(c)^2*tan(
d*x)^4+32*b*d*x*tan(c)^2*tan(d*x)^2+16*b*d*x*tan(c)^2+8*b*d*x*tan(d*x)^4+16*b*d*x*tan(d*x)^2+8*b*d*x+3*b*pi*si
gn(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))*sign(2*tan(c)^2*tan(d*x)^2-2)*tan(c)^4*tan(d*x
)^4+6*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))*sign(2*tan(c)^2*tan(d*x)^2-2)*tan
(c)^4*tan(d*x)^2+3*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))*sign(2*tan(c)^2*tan(
d*x)^2-2)*tan(c)^4+6*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))*sign(2*tan(c)^2*ta
n(d*x)^2-2)*tan(c)^2*tan(d*x)^4+12*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))*sign
(2*tan(c)^2*tan(d*x)^2-2)*tan(c)^2*tan(d*x)^2+6*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*t
an(d*x))*sign(2*tan(c)^2*tan(d*x)^2-2)*tan(c)^2+3*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2
*tan(d*x))*sign(2*tan(c)^2*tan(d*x)^2-2)*tan(d*x)^4+6*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(
c)+2*tan(d*x))*sign(2*tan(c)^2*tan(d*x)^2-2)*tan(d*x)^2+3*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*
tan(c)+2*tan(d*x))*sign(2*tan(c)^2*tan(d*x)^2-2)+3*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+
2*tan(d*x))*tan(c)^4*tan(d*x)^4+6*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))*tan(c
)^4*tan(d*x)^2+3*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))*tan(c)^4+6*b*pi*sign(2
*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))*tan(c)^2*tan(d*x)^4+12*b*pi*sign(2*tan(c)^2*tan(d*
x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))*tan(c)^2*tan(d*x)^2+6*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d
*x)^2-2*tan(c)+2*tan(d*x))*tan(c)^2+3*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))*t
an(d*x)^4+6*b*pi*sign(2*tan(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))*tan(d*x)^2+3*b*pi*sign(2*ta
n(c)^2*tan(d*x)-2*tan(c)*tan(d*x)^2-2*tan(c)+2*tan(d*x))+6*b*atan((tan(c)+tan(d*x))/(tan(c)*tan(d*x)-1))*tan(c
)^4*tan(d*x)^4+12*b*atan((tan(c)+tan(d*x))/(tan(c)*tan(d*x)-1))*tan(c)^4*tan(d*x)^2+6*b*atan((tan(c)+tan(d*x))
/(tan(c)*tan(d*x)-1))*tan(c)^4+12*b*atan((tan(c)+tan(d*x))/(tan(c)*tan(d*x)-1))*tan(c)^2*tan(d*x)^4+24*b*atan(
(tan(c)+tan(d*x))/(tan(c)*tan(d*x)-1))*tan(c)^2*tan(d*x)^2+12*b*atan((tan(c)+tan(d*x))/(tan(c)*tan(d*x)-1))*ta
n(c)^2+6*b*atan((tan(c)+tan(d*x))/(tan(c)*tan(d*x)-1))*tan(d*x)^4+12*b*atan((tan(c)+tan(d*x))/(tan(c)*tan(d*x)
-1))*tan(d*x)^2+6*b*atan((tan(c)+tan(d*x))/(tan(c)*tan(d*x)-1))-6*b*atan((tan(c)-tan(d*x))/(tan(c)*tan(d*x)+1)
)*tan(c)^4*tan(d*x)^4-12*b*atan((tan(c)-tan(d*x))/(tan(c)*tan(d*x)+1))*tan(c)^4*tan(d*x)^2-6*b*atan((tan(c)-ta
n(d*x))/(tan(c)*tan(d*x)+1))*tan(c)^4-12*b*atan((tan(c)-tan(d*x))/(tan(c)*tan(d*x)+1))*tan(c)^2*tan(d*x)^4-24*
b*atan((tan(c)-tan(d*x))/(tan(c)*tan(d*x)+1))*tan(c)^2*tan(d*x)^2-12*b*atan((tan(c)-tan(d*x))/(tan(c)*tan(d*x)
+1))*tan(c)^2-6*b*atan((tan(c)-tan(d*x))/(tan(c)*tan(d*x)+1))*tan(d*x)^4-12*b*atan((tan(c)-tan(d*x))/(tan(c)*t
an(d*x)+1))*tan(d*x)^2-6*b*atan((tan(c)-tan(d*x))/(tan(c)*tan(d*x)+1))+8*b*tan(c)^4*tan(d*x)^3-8*b*tan(c)^4*ta
n(d*x)+8*b*tan(c)^3*tan(d*x)^4-48*b*tan(c)^3*tan(d*x)^2+8*b*tan(c)^3-48*b*tan(c)^2*tan(d*x)^3+48*b*tan(c)^2*ta
n(d*x)-8*b*tan(c)*tan(d*x)^4+48*b*tan(c)*tan(d*x)^2-8*b*tan(c)+8*b*tan(d*x)^3-8*b*tan(d*x))/(64*d*tan(c)^4*tan
(d*x)^4+128*d*tan(c)^4*tan(d*x)^2+64*d*tan(c)^4+128*d*tan(c)^2*tan(d*x)^4+256*d*tan(c)^2*tan(d*x)^2+128*d*tan(
c)^2+64*d*tan(d*x)^4+128*d*tan(d*x)^2+64*d)

________________________________________________________________________________________

maple [A]  time = 0.59, size = 81, normalized size = 1.33 \[ \frac {a \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+b \left (-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^4*(a+b*tan(d*x+c)^2),x)

[Out]

1/d*(a*(1/4*(cos(d*x+c)^3+3/2*cos(d*x+c))*sin(d*x+c)+3/8*d*x+3/8*c)+b*(-1/4*cos(d*x+c)^3*sin(d*x+c)+1/8*cos(d*
x+c)*sin(d*x+c)+1/8*d*x+1/8*c))

________________________________________________________________________________________

maxima [A]  time = 1.69, size = 69, normalized size = 1.13 \[ \frac {{\left (d x + c\right )} {\left (3 \, a + b\right )} + \frac {{\left (3 \, a + b\right )} \tan \left (d x + c\right )^{3} + {\left (5 \, a - b\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{4} + 2 \, \tan \left (d x + c\right )^{2} + 1}}{8 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/8*((d*x + c)*(3*a + b) + ((3*a + b)*tan(d*x + c)^3 + (5*a - b)*tan(d*x + c))/(tan(d*x + c)^4 + 2*tan(d*x + c
)^2 + 1))/d

________________________________________________________________________________________

mupad [B]  time = 12.06, size = 67, normalized size = 1.10 \[ x\,\left (\frac {3\,a}{8}+\frac {b}{8}\right )+\frac {\left (\frac {3\,a}{8}+\frac {b}{8}\right )\,{\mathrm {tan}\left (c+d\,x\right )}^3+\left (\frac {5\,a}{8}-\frac {b}{8}\right )\,\mathrm {tan}\left (c+d\,x\right )}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^4+2\,{\mathrm {tan}\left (c+d\,x\right )}^2+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^4*(a + b*tan(c + d*x)^2),x)

[Out]

x*((3*a)/8 + b/8) + (tan(c + d*x)^3*((3*a)/8 + b/8) + tan(c + d*x)*((5*a)/8 - b/8))/(d*(2*tan(c + d*x)^2 + tan
(c + d*x)^4 + 1))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan ^{2}{\left (c + d x \right )}\right ) \cos ^{4}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**4*(a+b*tan(d*x+c)**2),x)

[Out]

Integral((a + b*tan(c + d*x)**2)*cos(c + d*x)**4, x)

________________________________________________________________________________________